1. Field of the Invention
The present invention relates to a direct current (DC) motor, and more particularly, to a method and an apparatus for controlling an object driven by a DC motor.
2. Description of the Related Art
An inkjet printer or a multi-function peripheral generally uses a DC motor or a step motor to drive a carrier having a head as a driven object. In particular, when the carrier is driven by the DC motor, interference may occur in the carrier due to a user or other external factors. In this case, even if interference is very serious, a conventional method of controlling the motor cannot stop the motor that is operating and cannot inform a user of this situation. In other words, the conventional motor controlling method continues to increase the duty cycle of a pulse width modulation (PWM) signal that controls the motor to overcome an external interference. Nevertheless, if the position of the object driven by the DC motor, i.e., the position of the carrier, does not reach a target position, the object is regarded as having an error. However, typically, because of such an external interference, a print paper may be torn during the continuous attempt to move the carrier.
The conventional motor controlling method attempts to change the position of the object using only information on the position of the object, and not information on the velocity of the object. In particular, when an external interference occurs during the operation of the DC motor, the conventional motor control method continuously increases the duty cycle of the PWM even though not needed, which causes other errors/problems, such as a paper tear, etc. Thus, the conventional motor control method does not sensitively check whether an error has occurred in the object (i.e., the conventional method does not detect a driven object error according to the object velocity in a time period). In particular, detecting a velocity error based upon the PWM signal would be low, because the output value of the PWM signal is maximized to overcome the external interference. In addition, if an external interference causes the motor object not to reach the target position during the driving of the DC motor, because the duty cycle of the PWM signal continues to increase to change, or attempt to change, the position of the object, a substantial amount of power is consumed.
Accordingly, the present invention provides a method of controlling a DC motor such that when an object driven by the DC motor errs due to an external interference, the error can be sensed and a user can be informed of this error, and additionally, the operating of the DC motor can be stopped.
The present invention also provides an apparatus performing the DC motor controlling method of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
The present invention may be achieved by a method of controlling a direct current motor driving an object, comprising if the object does not reach a target position, detecting from a predetermined velocity trajectory a reference velocity corresponding to a point of time when a first interrupt occurs, obtaining the position of the object, calculating a current velocity of the object updated whenever a second interrupt occurs (i.e., an updated current velocity in relation to the time of the first interrupt), and calculating a difference between the reference velocity and the current velocity, determining whether the difference is greater than a velocity error limit value, and if determined that the difference is greater than the velocity error limit value, informing a user that an error occurs.
The present invention may be also achieved by an apparatus controlling a direct current motor driving an object, comprising a buffer, a first comparator, a reference velocity detector, a position detector, a current velocity calculator, a difference detector, a second comparator, and an error informer. The buffer buffers and outputs a position of the object. The first comparator compares the position of the object input from the buffer with a target position in response to a first control signal and a first interrupt signal and outputs the comparison result as a second control signal. The reference velocity detector detects from a predetermined velocity trajectory a reference velocity corresponding to a point of time when the first interrupt signal occurs, in response to the second control signal and the first interrupt signal. The position detector detects the position of the object in response to the second control signal and the first interrupt signal and outputs the detected position of the object to the buffer. The current velocity calculator calculates a current velocity of the object updated whenever a second interrupt signal occurs in response to the second control signal and the first interrupt signal. The difference detector calculates and outputs a difference between the reference velocity and the current velocity. The second comparator compares the difference with a velocity error limit value and outputs the comparison result as a third control signal. The error informer informs a user that an error occurs in response to the third control signal. According to an aspect of the present invention, the second interrupt signal occurs more frequently than the first interrupt signal.